\section{Results}
\label{sec:results}
In this section we will discuss the results of this assignment, and evaluate our solution.
\\\\
In general we are very satisfied with our result, since we have done a lot more than what was required by the exercise. Our perhaps overly ambitious approach to the assignment led to several problems along the road, and retrospectively we should have done a few things differently.
\\\\
As mentioned in the introduction the simultaneous playback does not work properly. We have tried to combine multiple samples together by simply adding them and by averaging. Neither has given correct results. In our defense we have not used a lot of time dwelling on the problem since it is not a requirement of the assignment.
\\\\
A perhaps bigger problem is that we build our "music" at runtime, thus cluttering up the main memory. We should fix this by moving the note arrays in \emph{Song} to constant arrays so the data will be stored in the ROM.
\\\\
Our sines should be regenerated to match the actual sampling frequency. This is a very easy operation, though we simply forgot to do it, and do not have the time left to do it. Another problem with our sines is that they take up a lot of memory because of the \emph{double} datatype. We intially thought it was important to have very good accuracy on the sine samples. It is not, and they should be changed to a \emph{short} datatype.
\\\\
The octavial shifts are pretty ad hoc. The problem when moving upwards is that we skip samples, thus the sampling resolutions on the higher octaves are quite crude. This could be fixed creating sine samples for the highest allowed octave (eight), however it would increase the number of samples by sixteen. For the lower octaves the problem is that the samples are repeated too many times, introducing audible artefacts. Instead of simply repeating a sample, we should have implemented an interpolation scheme between samples, though such a scheme would introduce additional computation.
\\\\
On the positive side we have a somewhat versatile setup which is pretty much good to go for the third assignment, where we can implement cool effects such as positional audio and background music.



